//
// Created by lygin on 2022/2/6.
//

#ifndef WUXIACHUANSHUO_WORKERMANAGER_H
#define WUXIACHUANSHUO_WORKERMANAGER_H

#include <iostream>
#include <fstream>
#include <algorithm>
#include "worker.h"
#include "bangZhong.h"
#include "JinYing.h"
#include "TangZhu.h"

using namespace std;

#define FILE_STORAGE_NAME "wuxiachuanshuo.txt"

class WorkerManager {
public:
    WorkerManager();

    void ShowMenu();

    void ExitSystem();

    void AddWorker();

    void ShowWorker();

    void Save();

    void Load(ifstream &ifs);

    int IsExist(int id);
    int IsExist(string name);

    void DeleteWorker();

    void EditWorker();

    void FindWorker();

    void SortWorker();

    void CleanFile();

    ~WorkerManager();

    bool m_fileExist;
    int m_totalWorkerNum;
    //Worker数组
    Worker **m_workerArray;
};

#endif //WUXIACHUANSHUO_WORKERMANAGER_H
